#define _CRT_SECURE_NO_WARNINGS 1
#include "Sort.h"


void TestInsertSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	InsertSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestShellSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	InsertSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestSelectSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	InsertSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestHeapSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	HeapSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestBubblleSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	BubblleSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestQuickSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	QuickSort(a, 0, sizeof(a) / sizeof(int) - 1);
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestQuickSortNonR()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	QuickSort(a, 0, sizeof(a) / sizeof(int) - 1);
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestMegeSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	MergeSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}


void TestMergeSortNonR1()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	MergeSortNonR1(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestMergeSortNonR2()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	MergeSortNonR2(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

void TestCountSort()
{
	int a[] = { 2,3,5,6,8,9,1,4,7,0 };
	PrintArrary(a, sizeof(a) / sizeof(int));
	CountSort(a, sizeof(a) / sizeof(int));
	PrintArrary(a, sizeof(a) / sizeof(int));
}

int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestHeapSort();
	//TestBubblleSort();
	//TestQuickSort();
	//TestQuickSortNonR();
	//TestMegeSort();
	//TestMergeSortNonR1();
	//TestMergeSortNonR2();
	TestCountSort();
	return 0;
}